package bufete;

import callProcs.ProcsInsertar;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import org.jvnet.substance.SubstanceLookAndFeel;

/**
 *
 * @author Jito
 */
public class EditarCasos extends javax.swing.JFrame {
        String idcaso, usuario;
        String comilla = new Character((char)34).toString();
    /** Creates new form EditarCasos */
    public EditarCasos() {
       
//        l_usuario.setText(usuario);
        initComponents();
//         JFrame.setDefaultLookAndFeelDecorated(true);
        B_CancelaCaso.setVisible(false);
        
        EC_TelefonoClienteIngreso.setVisible(false);
        EC_TelefonoCliente.setVisible(false);
        LFenecidoen.setVisible(false);
        LFenecido.setVisible(false);
        ProcsInsertar VerAsunto =new ProcsInsertar();
        String idAsunto[];
        jCalendar1.setVisible(false);
        java.sql.ResultSet rs;
        try {
            rs = VerAsunto.VerAsuntosCaso();
            idAsunto = new String[200];
            int cont=0;
            while (rs.next()){
                idAsunto[cont] = rs.getObject("idAsunto").toString();
                cont++;
                EC_AsuntoCasoIngreso.addItem(rs.getObject("NombreAsunto"));
            }
        } catch (SQLException ex) {
            Logger.getLogger(Casos.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jMenuBar2 = new javax.swing.JMenuBar();
        jMenu3 = new javax.swing.JMenu();
        jMenu4 = new javax.swing.JMenu();
        jMenuBar3 = new javax.swing.JMenuBar();
        jMenu5 = new javax.swing.JMenu();
        jMenu6 = new javax.swing.JMenu();
        jMenuBar4 = new javax.swing.JMenuBar();
        jMenu7 = new javax.swing.JMenu();
        jMenu8 = new javax.swing.JMenu();
        CE_ClientePanel = new javax.swing.JPanel();
        C_Cliente = new javax.swing.JLabel();
        EC_NombreCliente = new javax.swing.JLabel();
        EC_DireccionClienteIngreso = new javax.swing.JLabel();
        EC_TelefonoCliente = new javax.swing.JLabel();
        EC_TelefonoClienteIngreso = new javax.swing.JLabel();
        EC_NombreClienteIng = new javax.swing.JLabel();
        EC_DireccionCliente1 = new javax.swing.JLabel();
        EC_DireccionClienteIngreso1 = new javax.swing.JLabel();
        EC_DireccionCliente = new javax.swing.JLabel();
        EC_CasoPanel = new javax.swing.JPanel();
        EC_Caso = new javax.swing.JLabel();
        EC_tipoCaso = new javax.swing.JLabel();
        EC_NoFolio = new javax.swing.JLabel();
        EC_tipoCasoIng = new javax.swing.JComboBox();
        EC_AsuntoCaso = new javax.swing.JLabel();
        EC_AsuntoCasoIngreso = new javax.swing.JComboBox();
        EC_NoFolioIngreso = new javax.swing.JTextField();
        EC_DescripcionCaso = new javax.swing.JLabel();
        EC_ObservacionCaso = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        EC_DescripcionCasoIngreso = new javax.swing.JTextPane();
        jScrollPane2 = new javax.swing.JScrollPane();
        EC_ObservacionesCasoIngreso = new javax.swing.JTextPane();
        jRadioButton1 = new javax.swing.JRadioButton();
        jRadioButton2 = new javax.swing.JRadioButton();
        jCalendar1 = new org.freixas.jcalendar.JCalendarCombo();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        LFenecidoen = new javax.swing.JLabel();
        LFenecido = new javax.swing.JLabel();
        Lfechainicio = new javax.swing.JLabel();
        EC_BotonEditar = new javax.swing.JButton();
        EC_BotonAceptar = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        B_CancelaCaso = new javax.swing.JButton();
        l_usuario = new javax.swing.JLabel();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenuItem2 = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        jMenu9 = new javax.swing.JMenu();
        jMenuItem3 = new javax.swing.JMenuItem();
        jMenuItem4 = new javax.swing.JMenuItem();

        jMenuBar2.setName("jMenuBar2"); // NOI18N

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(bufete.BufeteApp.class).getContext().getResourceMap(EditarCasos.class);
        jMenu3.setText(resourceMap.getString("jMenu3.text")); // NOI18N
        jMenu3.setName("jMenu3"); // NOI18N
        jMenuBar2.add(jMenu3);

        jMenu4.setText(resourceMap.getString("jMenu4.text")); // NOI18N
        jMenu4.setName("jMenu4"); // NOI18N
        jMenuBar2.add(jMenu4);

        jMenuBar3.setName("jMenuBar3"); // NOI18N

        jMenu5.setText(resourceMap.getString("jMenu5.text")); // NOI18N
        jMenu5.setName("jMenu5"); // NOI18N
        jMenuBar3.add(jMenu5);

        jMenu6.setText(resourceMap.getString("jMenu6.text")); // NOI18N
        jMenu6.setName("jMenu6"); // NOI18N
        jMenuBar3.add(jMenu6);

        jMenuBar4.setName("jMenuBar4"); // NOI18N

        jMenu7.setText(resourceMap.getString("jMenu7.text")); // NOI18N
        jMenu7.setName("jMenu7"); // NOI18N
        jMenuBar4.add(jMenu7);

        jMenu8.setText(resourceMap.getString("jMenu8.text")); // NOI18N
        jMenu8.setName("jMenu8"); // NOI18N
        jMenuBar4.add(jMenu8);

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle(resourceMap.getString("Form.title")); // NOI18N
        setFont(resourceMap.getFont("Form.font")); // NOI18N
        setName("Form"); // NOI18N

        CE_ClientePanel.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        CE_ClientePanel.setName("CE_ClientePanel"); // NOI18N

        C_Cliente.setFont(resourceMap.getFont("C_Cliente.font")); // NOI18N
        C_Cliente.setText(resourceMap.getString("C_Cliente.text")); // NOI18N
        C_Cliente.setName("C_Cliente"); // NOI18N

        EC_NombreCliente.setFont(resourceMap.getFont("EC_NombreCliente.font")); // NOI18N
        EC_NombreCliente.setText(resourceMap.getString("EC_NombreCliente.text")); // NOI18N
        EC_NombreCliente.setName("EC_NombreCliente"); // NOI18N

        EC_DireccionClienteIngreso.setText(resourceMap.getString("EC_DireccionClienteIngreso.text")); // NOI18N
        EC_DireccionClienteIngreso.setEnabled(false);
        EC_DireccionClienteIngreso.setName("EC_DireccionClienteIngreso"); // NOI18N

        EC_TelefonoCliente.setFont(resourceMap.getFont("EC_TelefonoCliente.font")); // NOI18N
        EC_TelefonoCliente.setText(resourceMap.getString("EC_TelefonoCliente.text")); // NOI18N
        EC_TelefonoCliente.setName("EC_TelefonoCliente"); // NOI18N

        EC_TelefonoClienteIngreso.setText(resourceMap.getString("EC_TelefonoClienteIngreso.text")); // NOI18N
        EC_TelefonoClienteIngreso.setEnabled(false);
        EC_TelefonoClienteIngreso.setName("EC_TelefonoClienteIngreso"); // NOI18N

        EC_NombreClienteIng.setText(resourceMap.getString("EC_NombreClienteIng.text")); // NOI18N
        EC_NombreClienteIng.setEnabled(false);
        EC_NombreClienteIng.setName("EC_NombreClienteIng"); // NOI18N

        EC_DireccionCliente1.setFont(resourceMap.getFont("EC_DireccionCliente1.font")); // NOI18N
        EC_DireccionCliente1.setText(resourceMap.getString("EC_DireccionCliente1.text")); // NOI18N
        EC_DireccionCliente1.setName("EC_DireccionCliente1"); // NOI18N

        EC_DireccionClienteIngreso1.setText(resourceMap.getString("EC_DireccionClienteIngreso1.text")); // NOI18N
        EC_DireccionClienteIngreso1.setEnabled(false);
        EC_DireccionClienteIngreso1.setName("EC_DireccionClienteIngreso1"); // NOI18N

        EC_DireccionCliente.setFont(resourceMap.getFont("EC_DireccionCliente.font")); // NOI18N
        EC_DireccionCliente.setText(resourceMap.getString("EC_DireccionCliente.text")); // NOI18N
        EC_DireccionCliente.setName("EC_DireccionCliente"); // NOI18N

        javax.swing.GroupLayout CE_ClientePanelLayout = new javax.swing.GroupLayout(CE_ClientePanel);
        CE_ClientePanel.setLayout(CE_ClientePanelLayout);
        CE_ClientePanelLayout.setHorizontalGroup(
            CE_ClientePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(CE_ClientePanelLayout.createSequentialGroup()
                .addGroup(CE_ClientePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(CE_ClientePanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(CE_ClientePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(CE_ClientePanelLayout.createSequentialGroup()
                                .addGroup(CE_ClientePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(EC_TelefonoCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(EC_DireccionCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(18, 18, 18))
                            .addGroup(CE_ClientePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(CE_ClientePanelLayout.createSequentialGroup()
                                    .addComponent(EC_DireccionCliente1)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED))
                                .addGroup(CE_ClientePanelLayout.createSequentialGroup()
                                    .addComponent(EC_NombreCliente, javax.swing.GroupLayout.DEFAULT_SIZE, 54, Short.MAX_VALUE)
                                    .addGap(44, 44, 44))))
                        .addGroup(CE_ClientePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, CE_ClientePanelLayout.createSequentialGroup()
                                .addComponent(EC_DireccionClienteIngreso1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addGap(1510, 1510, 1510))
                            .addGroup(CE_ClientePanelLayout.createSequentialGroup()
                                .addComponent(EC_TelefonoClienteIngreso, javax.swing.GroupLayout.PREFERRED_SIZE, 146, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 1364, Short.MAX_VALUE))
                            .addComponent(EC_DireccionClienteIngreso, javax.swing.GroupLayout.DEFAULT_SIZE, 1510, Short.MAX_VALUE)
                            .addComponent(EC_NombreClienteIng, javax.swing.GroupLayout.PREFERRED_SIZE, 525, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(CE_ClientePanelLayout.createSequentialGroup()
                        .addGap(362, 362, 362)
                        .addComponent(C_Cliente)))
                .addContainerGap())
        );
        CE_ClientePanelLayout.setVerticalGroup(
            CE_ClientePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(CE_ClientePanelLayout.createSequentialGroup()
                .addComponent(C_Cliente)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(CE_ClientePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(EC_NombreCliente)
                    .addComponent(EC_NombreClienteIng))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 8, Short.MAX_VALUE)
                .addGroup(CE_ClientePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(EC_DireccionCliente1)
                    .addComponent(EC_DireccionClienteIngreso1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(CE_ClientePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(EC_DireccionCliente)
                    .addComponent(EC_DireccionClienteIngreso))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(CE_ClientePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(EC_TelefonoCliente)
                    .addComponent(EC_TelefonoClienteIngreso))
                .addContainerGap())
        );

        EC_CasoPanel.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        EC_CasoPanel.setName("EC_CasoPanel"); // NOI18N

        EC_Caso.setFont(resourceMap.getFont("EC_Caso.font")); // NOI18N
        EC_Caso.setText(resourceMap.getString("EC_Caso.text")); // NOI18N
        EC_Caso.setName("EC_Caso"); // NOI18N

        EC_tipoCaso.setFont(resourceMap.getFont("EC_tipoCaso.font")); // NOI18N
        EC_tipoCaso.setText(resourceMap.getString("EC_tipoCaso.text")); // NOI18N
        EC_tipoCaso.setName("EC_tipoCaso"); // NOI18N

        EC_NoFolio.setFont(resourceMap.getFont("EC_NoFolio.font")); // NOI18N
        EC_NoFolio.setText(resourceMap.getString("EC_NoFolio.text")); // NOI18N
        EC_NoFolio.setName("EC_NoFolio"); // NOI18N

        EC_tipoCasoIng.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Penal", "Laboral", "Civil" }));
        EC_tipoCasoIng.setEnabled(false);
        EC_tipoCasoIng.setName("EC_tipoCasoIng"); // NOI18N

        EC_AsuntoCaso.setFont(resourceMap.getFont("EC_AsuntoCaso.font")); // NOI18N
        EC_AsuntoCaso.setText(resourceMap.getString("EC_AsuntoCaso.text")); // NOI18N
        EC_AsuntoCaso.setName("EC_AsuntoCaso"); // NOI18N

        EC_AsuntoCasoIngreso.setEnabled(false);
        EC_AsuntoCasoIngreso.setName("EC_AsuntoCasoIngreso"); // NOI18N
        EC_AsuntoCasoIngreso.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                EC_AsuntoCasoIngresoActionPerformed(evt);
            }
        });

        EC_NoFolioIngreso.setEnabled(false);
        EC_NoFolioIngreso.setName("EC_NoFolioIngreso"); // NOI18N

        EC_DescripcionCaso.setFont(resourceMap.getFont("EC_DescripcionCaso.font")); // NOI18N
        EC_DescripcionCaso.setText(resourceMap.getString("EC_DescripcionCaso.text")); // NOI18N
        EC_DescripcionCaso.setName("EC_DescripcionCaso"); // NOI18N

        EC_ObservacionCaso.setFont(resourceMap.getFont("EC_ObservacionCaso.font")); // NOI18N
        EC_ObservacionCaso.setText(resourceMap.getString("EC_ObservacionCaso.text")); // NOI18N
        EC_ObservacionCaso.setName("EC_ObservacionCaso"); // NOI18N

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        EC_DescripcionCasoIngreso.setEnabled(false);
        EC_DescripcionCasoIngreso.setName("EC_DescripcionCasoIngreso"); // NOI18N
        jScrollPane1.setViewportView(EC_DescripcionCasoIngreso);

        jScrollPane2.setName("jScrollPane2"); // NOI18N

        EC_ObservacionesCasoIngreso.setEnabled(false);
        EC_ObservacionesCasoIngreso.setName("EC_ObservacionesCasoIngreso"); // NOI18N
        jScrollPane2.setViewportView(EC_ObservacionesCasoIngreso);

        jRadioButton1.setFont(resourceMap.getFont("jRadioButton2.font")); // NOI18N
        jRadioButton1.setText(resourceMap.getString("jRadioButton1.text")); // NOI18N
        jRadioButton1.setEnabled(false);
        jRadioButton1.setName("jRadioButton1"); // NOI18N
        jRadioButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jRadioButton1ActionPerformed(evt);
            }
        });
        jRadioButton1.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jRadioButton1KeyPressed(evt);
            }
        });

        jRadioButton2.setFont(resourceMap.getFont("jRadioButton2.font")); // NOI18N
        jRadioButton2.setText(resourceMap.getString("jRadioButton2.text")); // NOI18N
        jRadioButton2.setEnabled(false);
        jRadioButton2.setName("jRadioButton2"); // NOI18N
        jRadioButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jRadioButton2ActionPerformed(evt);
            }
        });

        jCalendar1.setEditable(true);
        jCalendar1.setName("jCalendar1"); // NOI18N

        jLabel2.setFont(resourceMap.getFont("jLabel2.font")); // NOI18N
        jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
        jLabel2.setName("jLabel2"); // NOI18N

        jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
        jLabel3.setName("jLabel3"); // NOI18N

        LFenecidoen.setFont(resourceMap.getFont("LFenecidoen.font")); // NOI18N
        LFenecidoen.setText(resourceMap.getString("LFenecidoen.text")); // NOI18N
        LFenecidoen.setName("LFenecidoen"); // NOI18N

        LFenecido.setName("LFenecido"); // NOI18N

        Lfechainicio.setText(resourceMap.getString("Lfechainicio.text")); // NOI18N
        Lfechainicio.setName("Lfechainicio"); // NOI18N

        javax.swing.GroupLayout EC_CasoPanelLayout = new javax.swing.GroupLayout(EC_CasoPanel);
        EC_CasoPanel.setLayout(EC_CasoPanelLayout);
        EC_CasoPanelLayout.setHorizontalGroup(
            EC_CasoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(EC_CasoPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(EC_CasoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(EC_CasoPanelLayout.createSequentialGroup()
                        .addComponent(jRadioButton2)
                        .addGap(18, 18, 18)
                        .addComponent(jCalendar1, javax.swing.GroupLayout.PREFERRED_SIZE, 204, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(52, 52, 52)
                        .addComponent(LFenecidoen, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(LFenecido, javax.swing.GroupLayout.PREFERRED_SIZE, 163, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(EC_CasoPanelLayout.createSequentialGroup()
                        .addGroup(EC_CasoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(EC_ObservacionCaso)
                            .addComponent(EC_DescripcionCaso)
                            .addComponent(EC_NoFolio)
                            .addComponent(EC_tipoCaso)
                            .addComponent(jLabel2))
                        .addGap(18, 18, 18)
                        .addGroup(EC_CasoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, EC_CasoPanelLayout.createSequentialGroup()
                                .addGroup(EC_CasoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(EC_tipoCasoIng, javax.swing.GroupLayout.Alignment.LEADING, 0, 244, Short.MAX_VALUE)
                                    .addComponent(EC_NoFolioIngreso, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(EC_CasoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(EC_AsuntoCaso)
                                    .addComponent(Lfechainicio, javax.swing.GroupLayout.PREFERRED_SIZE, 262, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(EC_CasoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(EC_CasoPanelLayout.createSequentialGroup()
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(EC_AsuntoCasoIngreso, javax.swing.GroupLayout.PREFERRED_SIZE, 333, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(EC_CasoPanelLayout.createSequentialGroup()
                                        .addGap(82, 82, 82)
                                        .addComponent(jRadioButton1))))
                            .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 741, Short.MAX_VALUE)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING)))
                    .addGroup(EC_CasoPanelLayout.createSequentialGroup()
                        .addGap(441, 441, 441)
                        .addComponent(EC_Caso)))
                .addContainerGap(412, Short.MAX_VALUE))
        );
        EC_CasoPanelLayout.setVerticalGroup(
            EC_CasoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(EC_CasoPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(EC_CasoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(EC_CasoPanelLayout.createSequentialGroup()
                        .addGap(21, 21, 21)
                        .addGroup(EC_CasoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel2))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 35, Short.MAX_VALUE)
                        .addGroup(EC_CasoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(EC_tipoCasoIng, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(EC_AsuntoCaso)
                            .addComponent(EC_AsuntoCasoIngreso, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(EC_tipoCaso)))
                    .addGroup(EC_CasoPanelLayout.createSequentialGroup()
                        .addComponent(EC_Caso)
                        .addGap(74, 74, 74)))
                .addGap(18, 18, 18)
                .addGroup(EC_CasoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(EC_CasoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(EC_NoFolioIngreso, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(EC_NoFolio)
                        .addComponent(jRadioButton1))
                    .addComponent(Lfechainicio, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(10, 10, 10)
                .addGroup(EC_CasoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(EC_CasoPanelLayout.createSequentialGroup()
                        .addGap(36, 36, 36)
                        .addComponent(EC_DescripcionCaso)
                        .addGap(57, 57, 57))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, EC_CasoPanelLayout.createSequentialGroup()
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)))
                .addGroup(EC_CasoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(EC_ObservacionCaso)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(25, 25, 25)
                .addGroup(EC_CasoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(EC_CasoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jRadioButton2)
                        .addComponent(jCalendar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(LFenecidoen))
                    .addComponent(LFenecido, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(37, 37, 37))
        );

        EC_BotonEditar.setIcon(resourceMap.getIcon("EC_BotonEditar.icon")); // NOI18N
        EC_BotonEditar.setText(resourceMap.getString("EC_BotonEditar.text")); // NOI18N
        EC_BotonEditar.setName("EC_BotonEditar"); // NOI18N
        EC_BotonEditar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                EC_BotonEditarActionPerformed(evt);
            }
        });

        EC_BotonAceptar.setIcon(resourceMap.getIcon("EC_BotonAceptar.icon")); // NOI18N
        EC_BotonAceptar.setText(resourceMap.getString("EC_BotonAceptar.text")); // NOI18N
        EC_BotonAceptar.setName("EC_BotonAceptar"); // NOI18N
        EC_BotonAceptar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                EC_BotonAceptarActionPerformed(evt);
            }
        });

        jLabel1.setIcon(resourceMap.getIcon("jLabel1.icon")); // NOI18N
        jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
        jLabel1.setName("jLabel1"); // NOI18N

        B_CancelaCaso.setIcon(resourceMap.getIcon("B_CancelaCaso.icon")); // NOI18N
        B_CancelaCaso.setText(resourceMap.getString("B_CancelaCaso.text")); // NOI18N
        B_CancelaCaso.setName("B_CancelaCaso"); // NOI18N
        B_CancelaCaso.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                B_CancelaCasoActionPerformed(evt);
            }
        });

        l_usuario.setName("l_usuario"); // NOI18N

        jMenuBar1.setName("jMenuBar1"); // NOI18N

        jMenu1.setName("jMenu1"); // NOI18N
        jMenu1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenu1ActionPerformed(evt);
            }
        });

        jMenuItem1.setName("jMenuItem1"); // NOI18N
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem1ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem1);

        jMenuItem2.setName("jMenuItem2"); // NOI18N
        jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem2ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem2);

        jMenuBar1.add(jMenu1);

        jMenu2.setName("jMenu2"); // NOI18N
        jMenuBar1.add(jMenu2);

        jMenu9.setText(resourceMap.getString("jMenu9.text")); // NOI18N
        jMenu9.setName("jMenu9"); // NOI18N

        jMenuItem3.setText(resourceMap.getString("jMenuItem3.text")); // NOI18N
        jMenuItem3.setName("jMenuItem3"); // NOI18N
        jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem3ActionPerformed(evt);
            }
        });
        jMenu9.add(jMenuItem3);

        jMenuItem4.setText(resourceMap.getString("jMenuItem4.text")); // NOI18N
        jMenuItem4.setName("jMenuItem4"); // NOI18N
        jMenuItem4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem4ActionPerformed(evt);
            }
        });
        jMenu9.add(jMenuItem4);

        jMenuBar1.add(jMenu9);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addGap(665, 665, 665)
                        .addComponent(B_CancelaCaso)
                        .addGap(28, 28, 28)
                        .addComponent(EC_BotonEditar, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(29, 29, 29)
                        .addComponent(EC_BotonAceptar, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(CE_ClientePanel, 0, 1382, Short.MAX_VALUE)
                    .addComponent(EC_CasoPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(l_usuario))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(l_usuario)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(CE_ClientePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(26, 26, 26)
                .addComponent(EC_CasoPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 129, Short.MAX_VALUE)
                        .addContainerGap())
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(B_CancelaCaso, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(EC_BotonEditar, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(EC_BotonAceptar, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(67, 67, 67))))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed
        Ver_Seguimiento_caso ver = new Ver_Seguimiento_caso();
        ver.setVisible(true);
        ver.get_idcaso(idcaso);
        ver.llena_tabla();
        ver.set_user(usuario);
    }//GEN-LAST:event_jMenuItem3ActionPerformed

    private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem4ActionPerformed
        Seguimiento seg = new Seguimiento();
        seg.setVisible(true);
        seg.get_idCaso(idcaso);
        seg.set_user(usuario);
    }//GEN-LAST:event_jMenuItem4ActionPerformed

public void set_user(String user)
    {
        usuario = user;
    }

    private void EC_BotonEditarActionPerformed(java.awt.event.ActionEvent evt) {                                               
        try {
            ProcsInsertar caso = new ProcsInsertar();
            
            
            if(caso.estado_caso(idcaso) == false) 
            {
               
                B_CancelaCaso.setVisible(true);
                EC_AsuntoCasoIngreso.setEnabled(true);
                EC_tipoCasoIng.setEnabled(true);
                EC_NoFolioIngreso.setEnabled(true);
                EC_DescripcionCasoIngreso.setEnabled(true);
                EC_ObservacionesCasoIngreso.setEnabled(true);
                jRadioButton1.setEnabled(true);
                jRadioButton2.setEnabled(true);
            }
            else JOptionPane.showMessageDialog(null, "El caso al que desea ingresar ha sido cancelado");
        } catch (SQLException ex) {
            Logger.getLogger(EditarCasos.class.getName()).log(Level.SEVERE, null, ex);
        }
    
    
        
    }                                              

    public void verResultsetObtenerDatosCaso(java.sql.ResultSet rs ,String idCaso){
        try {
            while (rs.next()){
                EC_NombreClienteIng.setText(rs.getObject("nombre").toString());
                if (rs.getObject("Dpi_cliente")!=null && (rs.getObject("No_orden_cliente")!=null)) EC_DireccionClienteIngreso1.setText(rs.getObject("Dpi_cliente").toString());
                if (rs.getObject("No_orden_cliente")!=null && rs.getObject("Dpi_cliente")==null )  EC_DireccionClienteIngreso1.setText(rs.getObject("No_registro_cliente")+" "+rs.getObject("No_orden_cliente").toString());
                EC_DireccionClienteIngreso.setText(rs.getObject("Direccion_cliente").toString());
                if (rs.getObject("Estudiante_NoCarne")!=null) {
                    jLabel3.setText(rs.getObject("Estudiante_NoCarne").toString());
                    if (rs.getObject("Memorial")!= null) {
                        if (rs.getObject("Memorial").toString()=="true") jRadioButton1.setSelected(true);
                    }
                    if (rs.getObject("Fecha_fenecido")!=null){
                        LFenecido.setText(rs.getObject("Fecha_fenecido").toString());
                        LFenecido.setText("Fenecido en "+rs.getObject("Fecha_fenecido").toString());
                        LFenecido.setVisible(true);
                        //LFenecidoen.setVisible(true);
                        jRadioButton2.setVisible(false);
                    }
                }
                else jLabel3.setText("No hay estudiante Asignado a este Caso");
                EC_NoFolioIngreso.setText(rs.getObject("No_folio").toString());
                EC_DescripcionCasoIngreso.setText(rs.getObject("Descripcion_caso").toString());
                EC_ObservacionesCasoIngreso.setText(rs.getObject("Observaciones").toString());
                Lfechainicio.setText("Caso Iniciado en "+rs.getObject("Fecha_inicio"));
            }
        } catch (SQLException ex) {
            Logger.getLogger(EditarCasos.class.getName()).log(Level.SEVERE, null, ex);
        }
        this.idcaso=idCaso;
    }
    
    private void EC_BotonAceptarActionPerformed(java.awt.event.ActionEvent evt) {                                                
        // TODO add your handling code here:
        
        //mensaje de datos guardados 
        if (!EC_NoFolioIngreso.getText().isEmpty()){
            ProcsInsertar actualizarCaso = new ProcsInsertar();
            String memorial ="false",fechafin=null;
            if (jRadioButton1.isSelected()) memorial = "true";
            else memorial ="false";
            if (jRadioButton2.isSelected()) fechafin = "'"+Integer.toString(jCalendar1.getDate().getYear()+1900)+"-"+Integer.toString(jCalendar1.getDate().getMonth()+1)+"-"+Integer.toString(jCalendar1.getDate().getDay()+1)+"'";
             else fechafin="null";
            actualizarCaso.editarCaso(idcaso, String.valueOf(EC_AsuntoCasoIngreso.getSelectedIndex()+1), String.valueOf(EC_tipoCasoIng.getSelectedIndex()+1),EC_DescripcionCasoIngreso.getText(),fechafin,memorial,EC_NoFolioIngreso.getText(),EC_ObservacionesCasoIngreso.getText(), usuario);
            JOptionPane.showMessageDialog(null,"Datos Guardados");
        }else JOptionPane.showMessageDialog(null,"Ingrese un Numero de Folio");
    }                                               

    private void jRadioButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                              
        // TODO add your handling code here:
        if (jLabel3.getText().equals("No hay estudiante Asignado a este Caso")){
            JOptionPane.showMessageDialog(null,"Si el Caso no tiene Asignado Estudiante no se puede fenecer el Caso");
            jRadioButton2.setSelected(false);
        }else
        jCalendar1.setVisible(true);
    }                                             

    private void EC_AsuntoCasoIngresoActionPerformed(java.awt.event.ActionEvent evt) {                                                     
        // TODO add your handling code here:
    }                                                    

    private void jRadioButton1KeyPressed(java.awt.event.KeyEvent evt) {                                         
        // TODO add your handling code here:

    }                                        

    private void jRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                              
        // TODO add your handling code here:
        if (jLabel3.getText().equals("No hay estudiante Asignado a este Caso")){
            JOptionPane.showMessageDialog(null,"Si el Caso no tiene Asignado Estudiante no puede haber Memorial");
            jRadioButton1.setSelected(false);
        }
    }                                             

    private void B_CancelaCasoActionPerformed(java.awt.event.ActionEvent evt) {                                              
         ProcsInsertar actualiza = new ProcsInsertar();
         actualiza.Cancelar_caso(idcaso);
    }                                             

    private void jMenu1ActionPerformed(java.awt.event.ActionEvent evt) {                                       
        
    }                                      

    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {                                           
        Seguimiento seg = new Seguimiento();
        seg.setVisible(true);
        seg.get_idCaso(idcaso);
    }                                          

    private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {                                           
        Ver_Seguimiento_caso ver = new Ver_Seguimiento_caso();
        ver.get_idcaso(idcaso);
        ver.llena_tabla();
        ver.setVisible(true);
        
       
    }                                          

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
            
//                JFrame.setDefaultLookAndFeelDecorated(true);
                
                
                //SubstanceLookAndFeel.setCurrentTheme("org.jvnet.substance.theme.SubstanceSteelBlueTheme");
                new EditarCasos().setVisible(true);
                    
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton B_CancelaCaso;
    private javax.swing.JPanel CE_ClientePanel;
    private javax.swing.JLabel C_Cliente;
    private javax.swing.JLabel EC_AsuntoCaso;
    private javax.swing.JComboBox EC_AsuntoCasoIngreso;
    private javax.swing.JButton EC_BotonAceptar;
    private javax.swing.JButton EC_BotonEditar;
    private javax.swing.JLabel EC_Caso;
    private javax.swing.JPanel EC_CasoPanel;
    private javax.swing.JLabel EC_DescripcionCaso;
    private javax.swing.JTextPane EC_DescripcionCasoIngreso;
    private javax.swing.JLabel EC_DireccionCliente;
    private javax.swing.JLabel EC_DireccionCliente1;
    private javax.swing.JLabel EC_DireccionClienteIngreso;
    private javax.swing.JLabel EC_DireccionClienteIngreso1;
    private javax.swing.JLabel EC_NoFolio;
    private javax.swing.JTextField EC_NoFolioIngreso;
    private javax.swing.JLabel EC_NombreCliente;
    private javax.swing.JLabel EC_NombreClienteIng;
    private javax.swing.JLabel EC_ObservacionCaso;
    private javax.swing.JTextPane EC_ObservacionesCasoIngreso;
    private javax.swing.JLabel EC_TelefonoCliente;
    private javax.swing.JLabel EC_TelefonoClienteIngreso;
    private javax.swing.JLabel EC_tipoCaso;
    private javax.swing.JComboBox EC_tipoCasoIng;
    private javax.swing.JLabel LFenecido;
    private javax.swing.JLabel LFenecidoen;
    private javax.swing.JLabel Lfechainicio;
    private org.freixas.jcalendar.JCalendarCombo jCalendar1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JMenu jMenu4;
    private javax.swing.JMenu jMenu5;
    private javax.swing.JMenu jMenu6;
    private javax.swing.JMenu jMenu7;
    private javax.swing.JMenu jMenu8;
    private javax.swing.JMenu jMenu9;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuBar jMenuBar2;
    private javax.swing.JMenuBar jMenuBar3;
    private javax.swing.JMenuBar jMenuBar4;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JRadioButton jRadioButton1;
    private javax.swing.JRadioButton jRadioButton2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JLabel l_usuario;
    // End of variables declaration//GEN-END:variables
}
